package cn.gemiman.daoyi.module.cms.dal.mysql.appsitealbumphoto;

import java.util.*;

import cn.gemiman.daoyi.framework.common.pojo.PageResult;
import cn.gemiman.daoyi.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.gemiman.daoyi.framework.mybatis.core.mapper.BaseMapperX;
import cn.gemiman.daoyi.module.cms.dal.dataobject.appsitealbumphoto.AppSiteAlbumPhotoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.gemiman.daoyi.module.cms.controller.admin.appsitealbumphoto.vo.*;

/**
 * 相册照片 Mapper
 *
 * @author 道一源码
 */
@Mapper
public interface AppSiteAlbumPhotoMapper extends BaseMapperX<AppSiteAlbumPhotoDO> {

    default PageResult<AppSiteAlbumPhotoDO> selectPage(AppSiteAlbumPhotoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AppSiteAlbumPhotoDO>()
                .eqIfPresent(AppSiteAlbumPhotoDO::getAppSiteId, reqVO.getAppSiteId())
                .eqIfPresent(AppSiteAlbumPhotoDO::getAppId, reqVO.getAppId())
                .eqIfPresent(AppSiteAlbumPhotoDO::getAlbumId, reqVO.getAlbumId())
                .likeIfPresent(AppSiteAlbumPhotoDO::getDescription, reqVO.getDescription())
                .eqIfPresent(AppSiteAlbumPhotoDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(AppSiteAlbumPhotoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AppSiteAlbumPhotoDO::getId));
    }

}